package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * Entity定义
 *
 * @author MyName
 * @version 1.0
 * @date 2020-09-03
 * Copyright © MyCompany
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("ds_attribute")
public class AttributeEntity extends BaseCustomEntity {

    /**
     * table_id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * ref_type
     */
    @NotNull(message = "refType不能为空")
    @Length(max = 100, message = "人口数长度应小于100")
    @TableField()
    private String refType;

    /**
     * ref_relationship
     */
    @Length(max = 100, message = "refRelationship长度应小于100")
    @TableField()
    private String refRelationship;

    /**
     * ref_table
     */
    @Length(max = 100, message = "refTable长度应小于100")
    @TableField()
    private String refTable;

    @Length(max = 100, message = "ref_column")
    @TableField(exist = false)
    private boolean refColumn;

    @TableField(exist = false)
    private Date createTime;

    /**
     * 业务编码
     */
    @TableField()
    private String businessType;

    /**
     * 业务名
     */
    @TableField()
    private String businessName;

    /**
     * propType    ListType StringType LongType DecimalType
     * DateType DateRangeType BooleanType UrlType
     */
    @TableField()
    private Integer propType;

    /**
     * 列名
     */
    @TableField()
    private String propName;
    /**
     * 显示名
     */
    @TableField()
    private String propLabel;
    /**
     * 显示顺序
     */
    @TableField()
    private String propSort;
    /**
     * 显示字长
     */
    @TableField()
    private Integer propLength;
    /**
     * 是否可以为空
     */
    @TableField()
    private Integer nullable;
    /**
     * 扩展配置     json
     */
    @TableField()
    private String extensions;
    /**
     * 显示字段
     */
    @TableField()
    private String asColumn;
    /**
     * 显示标记
     */
    @TableField()
    private Boolean isVisible;
    /**
     * 更新时间
     */
    @TableField()
    private LocalDateTime updateTime;

}
